class TheFallenMight_Pawn extends GamePawn;
 /*	 ================================================
 *   ===============   variables   ==================
 *   ================================================
 */



 /*	 ================================================
 *   ===============    Startup    ==================
 *   ================================================
 */
 event PostBeginPlay()
{
    super.PostBeginPlay();
	`Log(SELF.Name);
	if(Controller != none) Controller.UnPossess();
	 if(Controller == none) SpawnDefaultController();
    //AddDefaultInventory(); //GameInfo calls it only for players, so we have to do it ourselves for AI.
}

/*	 ================================================
 *   ===============   Functions   ==================
 *   ================================================
 */
 /**
 * Returns true if the pawn needs to turn to the target location based on the precision value
 *
 * @param		TargetLocation			World target location
 * @param		Precision				Precision that the pawn needs to face that target location (usually from 0.f to 1.f)
 * @return								Returns false if the pawn is looking at the target location
 */
function bool NeedsToTurnWithPrecision(Vector TargetLocation, float Precision)
{
	local Vector LookDir, AimDir;

	LookDir = Vector(Rotation);
	LookDir.Z = 0.f;
	LookDir = Normal(LookDir);

	AimDir = TargetLocation - Location;
	AimDir.Z = 0.f;
	AimDir = Normal(AimDir);

	return ((LookDir Dot AimDir) < Precision);
}

defaultproperties
{
        Components.Remove(Sprite)

        Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
                ModShadowFadeoutTime=0.25
                MinTimeBetweenFullUpdates=0.2
                AmbientGlow=(R=.01,G=.01,B=.01,A=1)
                AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
                LightShadowMode=LightShadow_ModulateBetter
                ShadowFilterQuality=SFQ_High
                bSynthesizeSHLight=TRUE
        End Object
        Components.Add(MyLightEnvironment)

    Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
                CastShadow=true
                bCastDynamicShadow=true
                bOwnerNoSee=false
                LightEnvironment=MyLightEnvironment;
        BlockRigidBody=true;
        CollideActors=true;
        BlockZeroExtent=true;
                PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_CH_Corrupt_Male_Physics'
                AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_AimOffset'
                AnimSets(1)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
                AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
                SkeletalMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_CH_LIAM_Cathode'
        End Object
		ControllerClass=class'TheFallenMigh.TheFallenMight_SquadAIController'
        Mesh=InitialSkeletalMesh;
        Components.Add(InitialSkeletalMesh);
}
